fixed a bug in the shaping reward formulation. still not convinved that the results are as expected