add calculate function to app