Finished most of assignment 5.  Needs more comments and maybe more testing