Update algorithm.java