updated document and enhance command line handling