Quality control algorithms