substantial changes to man and some code changes too