Now appears to work for simplest case

This script now seems to work if you only specify -c and -o.  Still to do: implement -s, -p and -m.