refactor actual map plotting into separate function