slight commenting and consolidation of all printing code to after algorithmic code