realize method calc()