Added more database code