renaming stream to type. adding addn. func.