added all the functionality needed at the db level