Code used for CS193 taken in iTunesU