Edited print formatting
Refactored code to reduce printing redundancy