added another variation and fixed a problem with the ctype version