Finished coding methods for Week 15 writing problem