Change variable name i -> ti, j -> mi