Added utilities from joseph@larch.