In the current implementation, if the first pixel is bad, we wouldn't know that since we started testing the middle pixel of the next line. So, it's better to use edge enhancement techniques to include the first pixel in checking whether it's bad or not.