first working version of DB class