added addStreamMuResid and cleaned code some