made script to write popmap