C version, minor fix