Improving scrollbox size calculations