The procedure generates too many overlaps in some situation. After decompiling the old editor it's better but it still need some working on it.