Line 16: Corrected index i to be j
Line 47: Added contribution from z-direction to dist
Authored by: btabak 2010-12-13
Parent: [r1241]
Child: [r1243]