Improved voxel code, added comments