Modified of add(), added modulus p on the result