Cleanup

Cleanup of unused code and comments. Removed debug code.