added nbc1_calibrate and lots of changes