preliminary database stuff