qDebug removed, takeFirst corrected, comments added