extracted handleArgs() to make main() cleaner
reorganization in handleArgs(), plus a warning message when passed too many arguments