Cleaned up C code very slightly