added parse_args function