Added ability to maintain STATE value between rhf and scheduler function...

...s