Your task is to get rid of all balls. To achieve this you have to place ball in portal of the matching color. If you place ball to wrong one, it doubles.