Add prime function