Continued adding database code