Added authentication to the queries and sorted the gist output.