partial rewrite to c-s arch