could we just take the desired level as an argument to the function below.  Maybe with a default value?