Updated with C version and algorithm link