eliminates unnecessary transaction
adds a func to close db
changes to return a list
adds tests