finalized first part of HW4