Tidying code, no real changes
Change markerGen function to work with array of objects