Adding a kind of array on the query
And using mapname as global variable