various work including a control code stripping ported from xchat