fixes to variable scope
multiple location markers loop functioning