use a hashmap for matching queried nodes to the in memory list via id