Added base calculation logic
Added base calculation logic