loop and comments clean up