Fixed calculation
New functionality