clearing debug statements
removing debug statements
making stream maintenance more robust