patching in tripsta's changes