added support for state and function callback output in fsesolve