Commenting and cleaning up code