Add documentation to Algorithms.scala