final version for homework submission