Copy from Powerball project.