final tweaks and changes by Martin