Major refactoring: new iteration based method to find good arrangement