function querytocsv
Merge origin/master