sort when prining tree; unSKIP doctest