code to condense text data to binary; todo - still needs a lot of QA/QC