renamed variable to trainStream for clarity