moved the csv checking to its own file