Added Arend's optimal control code.