slight optimization: no longer check even numbers for primality