fix up issue where all the z-values were in [0,1].

we weren't accounting for the slice number we were on.
switch up tab to spaces
simple profiling changes.