Changed to recursive layout
Added calibration routine