Added preliminary database code