reordered positioning algorithm