Preliminary version of reduce