added more queries
fixed some syntax
merged
merged and changed functions to export