currently if input is taken and more than one character get's supplied, the first one is taken and all the other ones are ignored. Change this to use a stack like structure for storing the entire input and then taking new input only if the stack is empty