changed condition for broadcast, removed unused variables