implemented main with cli argument parsing