Update Algorithms.java

some comments to improve code