Added method to get all possible completions sorted by nesting level.