made more generic with user input from console