Finished parts 2 and 3 (lots of copying and pasting code)