Replaced handwritten for loop with std::find