finished homework 4

added comments and stuff