comments and general code cleanup