Added basic calculation logic