Native C version complete