More straightforward command line interface
fixed loop logic for sel mode
cleaning