part1 finished with some changes