updatred to use csv queries