mods from the linux box, that I hope make code functional elsewhere too.