completed all pairs
added negative cycle exception handling

added negative cycle exception handling