Completed code for week 3's class