Added some database code