calculation of part 2