minor refactoring to clean up main and commented out extra print statements