correct, pure C code 2 :)