Removed some debugging code from teh c++ version