fixed sml with built-in functions