Added getopts for optional argument parsing.