Added some more comments and cleaned up
Fixed merge