Implemented the database