writing the sortmgr new module