Working on database stuff

tighting it up