Updated problem 3 and 7 to use prime class