used each char and preinitialized ranges