Scala solutions for problems in EPI book