added most of the glue code. should now work simply by adding the db to the directory