Starting to add functionality to export data to external sqlite db - not yet functional