Added some code to apply the RHE algorithm to calculate circulations.