updating to allow it to continually ask for input with close and exit exit flags