Added command line code and tested