Reworked getChar for clarity and added more comments.