added solution for part2