work on stream implementation