waitForNewData(); now runs 2 iterations instead of three. A bit of commenting done.