more work on getting the data from the db