Changed broadcast_weights to broadcast_array