use lineReader rather than readline to better handle memory leaks