Careful!

If the first random line is the last line in the file you will get an out-of-bounds for random+1.