completely rebuilt the input handler and demo