finally, it runs in C!