finished homework for week-4-assignment-3