Finished Project 3, cleaned up code, added comments.