# routine to reduce