Passes tests with suggestion from scopatz