Added database code