HW5 fully working