add and modify prime function.