Updated with a faster and accurate prime finder function.