Updated for homework8