removing crossed edges