tested DB code