add one function to calculate obj