return correct number of levels