remove debugging statements and extraneous variables