push_back for std::vector might be slow, consider using reserve() or std::list