add reallocarray function, simple test program