Add calculation logic