implement a series of functions to improve csv validation