new style
fixed namespace invasion
fixed some errors spotted by Richard Heathfield