added some argument parsing logic