Cleaned and consolidated

Removed all debug lines and folded all code into on file.