Implemented Database functions