lots of added functionality, adding database setup