Use a loop to avoid recursion in the heightOfSelect() function.