calculate the values