example 6-3: fix order of returned list