C version with comment