some minor changes by Ivo