changing variable names to intuitive ones and the input error message