building out database functionality