removed cg_order, fixed bugs