implemented choose random stream function
added stream registration