added implementation with ord()