added db functionality
added db output