sort by batch if monoid is commutative (develop)