added in opening/closing database file, untested

need to test that read and write work correctly once we have add/remove up and running