some C code I wrote for fun