updated charTable generation algorithm