main-calculation