Code from lecture Oct 30