start to insert DB access into main loop, seg faulting...
..