Added comments, changed some variables to be constants