Added some more database code