lecture 15: fix stream