Refactored and improved broadcast function.
Implemented broadcast with failures.