Modify Print Statements and Remove Unnecessary Code