Updated for homework 4