Database queries and stuff

read above