Cleanup. Added comments. Formatted source.