Make countlines way more efficient

I don't know why this is faster but okay.