updated to use scala-util