added C reference function