Reworked gcode generation