added newly changed code. This source code is not in sycn with the current released version of the tab2mage importer.