Homework 3 fixed

made changes to the class