Updated for jug.
Generified.