switching to char packing
modified headers for new input/output