Optimization of dcs.c