tried version of part 3 using blithe's class solution