isPrime implementation

naive, but working fast for small numbers