add comments, pillars, refactored switching mode, final cleanup