making children into priority queue