tweak results writing
give credit for frozendict class
clean up read and writing of header