add calculate method