Replace i and j to y and x.