use Position object in more places instead of [i,j]