last query updated to return a map