Updated script for command line input