added orient test cases, fixed issues with index construction