Map and listings load properly now

Lesson learnt: In functional programming, provide inputs as arguments,
not shared variables