replaced ConvertToOrdinal with an easer to follow implementation