finished database stuff