fixed array index and add test files