update main calc logic and view