Make getLevels function public