added calculation code