resolves #501 Change char to ch to avoid keyword conflict