implemented the mult/div handling