some changes suggested by SteveC / yet untested