use charCodeAt instead of loop