Classifying order of nested functions