Database functions added (incomplete)