Added the function to identify the version of knowledge-base.
Added the option of rm_direction.