added part2 of homework