main calc