Algorithm for positioning 2d tile GUIs