Cleaned up debug messages and commented code