Update Algorithm.scala

Adding comments.