Added C Implementation