improving cotsoc()