added -w -od handling to tidy.sh