be careful about which should be calculate first