More flexible breakout script.