added facility for sorting actiondef and facts