Finished exercises from lecture 2.