Added in DB read and write functions.