Added command line implemetation.