Added function sign. Fixed function is_prime.