modified the way a block of courses is pulled out for the csv output.

this makes it more efficient