output can now be chosen: xml or tuple and some cleaning in Main