implemented all the builtin functions