used std::equal also for function