corrections thanks to Tim