Part 1 of Maker's week four challenge - rewriting inject method