How are traits inherited across generations?