organizes the output of gcode-lines into layers