-implementing streams using primitve funtions