* Refactored the code to uses Tuples as records
* Adopted the qry2 function to work with the new tuple structure