Fixed a big bug with tign and D() calculation!