Tested and removed some debugging code