improved validation gate using bunch algorithm to detect lines..