add database and edit code