add getopts and revert match split
Updated calling script to use new args