use getopts to execute functions