Why do you calculate y in step 5, but don't use it for anything?
In the Wikipedia article you link to (http://en.wikipedia.org/wiki/Hurst_exponent) they use this cumulative sum (what you call "the running total") in the calculation of R, but you use the deviations Y.