adding for history, not going to use sqlite db for now though. going to try to keep it all in memory and loop slices rather than query. but may come back to this.