Hacky implementation of native functions