THIS THE FINAL WORKING VERSION OF HW4