version before everything breaks
working state and belief
fixed gradient for controls