Using scala.collection.mutable.ListBuffer instead of scala.collection.mutable.Stack