added prim_wrapper