properly calculate .char index