Sample output matches test! A little code cleanup