implemented proper argument parsing code