Changed the layout algorithm.