found a way to find the position from a pair in an array