use i,j,k when computing ball
Merge pull request #1 from tmpvar/fix-ball

use i,j,k when computing ball