Added handling for no succesful path in Main.java