Fixing ordinal calculation