Removed unused functions, and commented-out debug statements