remove debugging and a couple of lines