Filled in the jail class

I haven't tested the code so I don't know how Scala-kosher it is.