added options and implemented support for -l --list option