fixed index with the original idea of binary