use map to store the results.