In this paper we will show how to set up a practical bonus-malus system with a finite number of classes. We will use the actual claim amount and claims frequency distributions in order to predict the future observed claims frequency when the new bonus-malus system will be in use. The future observed claims frequency is used to set up an optimal bonus-malus system as well as the transient and stationary distributions of the drivers in the new bonus-malus system. When the number of classes as well as the transition rules of the new bonus-malus system have been adopted, the premium levels are obtained by minimizing a certain distance between the levels of the practical bonus-malus system and the corresponding optimal bonus-malus system. Some iterations are necessary in order to reach stabilization of the future observed claims frequency and the levels of the practical bonus-malus system.