Assignment 3

pull request for assignment 3 - it's heavily commented and I'm not sure if that's good or bad. Thanks!