Changed tape detection to use lines.