merge IN/OUT section into RULES section