Started working on the database logic