changed char variable to currentChar