Figured out how to solve code eval in scala.