Update calculator logic