change order of ops.. diff counting method
fix issue on OS X bash