refactoring codes. add function to read .ivecs files.