Perform optimization separately on each voxel. Thanks @yarikoptic
for pointing this out.

Fixes issue #3