fixed mirror mode and cleaned up output to match the xml