removed index from loop in master function
factored output channel out of simulate