Wrote utility methods to reduce and compare quantities.