Cleanup of indentation. Removed old debug code. Added comments.