Cleanup: don't hand-implement binary search -- use std::lower_bound instead
Do not include <complex>, it is not used