added a z scale functioning and initial gcode generation