Solving for (x,y) in table