invert test and remove debugging statements