implemented the limitations to the number of problems output to the csv