changed local variables to std::vector instead of QVector for speed.