Added C version