added input function for command line