routine for reducing to zero variables case