reduceCube refactored to take Y axis