fleshed out database class