Improvements on command line, also added some comments.