Removing some debugging statements and cleaning up