that works best for me. put the "m" commands on separate lines after m6 tool change.