Steps 3 and 4 from hw4