Code from lecture time.