Uncommented onInputCancelled and added some comments