implemented command-line parsing