There might be some bugs in input.c. Take care of this!!!