Changed Algorithm.java