Some mods from Bruce Evans