maybe use heap to reduce complex in the bing word problem