added some of the code that adds objects to the db