improve calculations