added direct streaming code