solved bug with duplicate crossings