Check out LtCol Key's excellent paper: