Added the database functionality