finished generator function, you can now specifiy time delay and number of readings to get a generator, sweet!