replaced each do with none? in function prime