Refactored to use the Prime.prime method from the ruby standard library