heavy modifications to mod9
and edits to some other modules