fixing issues for both homeWork2 and 3