Added the C version