updated most queries to new schema
merged conflict