binary search implemented
i++ changed into ++i