Scala port of Ruby's flipper project