Added comments to clarify previous commit. Formatted code.