final version for homework1