cleaned up comments and removed degugging code