updated to use command-line arguments