Flush all data before attempting to read
Use a for loop, rather than some strange generator syntax