added prime detection