commenting and cleaning up code