Adding scala-style matching