added different operating modes via command-line options