add calculate logic