dcs.c optimization and clarification