add method for calculating result