fixed HW4 issues'