class version of part 1