Converted DTW to C