Working implementation of stream