Different popup positioning algorithm