character count using ranges added