Add totalNumberOfProblems and thisProblemNumber. Check NULL before comparison