Updated the optimized c version.