Update Algorithms.java

Will edit further later.  Also, feedback would be great.