This tutorial will show you how to process, sort, and analyse the query results.
You can see the script here
You can try live here