working version, except for the ggplot part of adding a map to the background