made collapse edge much faster