final version of homework 4