added prime number detection