minor optimizations. mass now is written during the gather stage.