I've written that isprime function so many times... all finished now