reimplement builtin functions