updated prime number check fun