Updated with a C example