initial work on array map. Turns out to be a bit harder than one might think...