See: http://prologic.shortcircuit.net.au