Updated prime function to accurately handle the number one, updated main to track sum.