fixed encoding issue, but not nicely

should use map/dict comp