fixed most of the bugs in the conversion to a new format