Finally corrected error.

I was using an incorrect denominator in k.
Also commented out some debug code.