Update lib.js

Fix ordinal with functions