This could be calculated once and stored instead of every time the button is clicked.