Added command line options, and works recursively.