Change order to get right modulus