re arranging the check for prime