Using pair instead of struct Pos