Adding functionality to access the database.  Still needs work