added -r command line option
added -r command line option