bug should be fixed

distribution was left to right instead of right to left

one of the energy contributions was wrong