e.g. for sorting an number array and nested function