added first working trace/plane cutting function