first functional version of stream.