added db code
working version