cooked variables but twist function still needs work because they can be negative values.
added deadband static vars