Initial work on assignment 1.

todo: add a lot more comments.