use emplace_back instead of push_back. change the order of parameters of is_pr