$lines[$i] =~ s/\r//g;