fixed a potential bug in continous actor-critic and cleaned up the code