removes "<output>" tag and adds base variables