OP-1309 get rid of this horrible bound() function code duplication throughout entire flight code and put it into libraries/math