update code to balance the measure