replace binarysearcharray with std::vector and std::lower_bound