C code from cs50