remove un-needed code and add comments