Fix ‘Maximum call stack size exceeded’ error

Using a while loop instead of a recursive function
Update names of calculators to match options