Polished the turd - added comments for future code maintenance