made and tested the prime function