Tutorial 205 Part 2 | Converting tutorial 173 to a function