Click on the buttons that say 1 2 3 to remove that amount of balls from the collection, press the button that says its rewind time in order to go back to the start.
I used code from AJLee5 for inspiration and other than that I made everything my own.