negative cycles detection added