Use charAt instead of indexOf. Cleaner