initial database code