using wc -l for faster IO