add getchar() method