Fix global leaked variable 'arr'

Add declaration at top of method.
Merge pull request #1 from jgable/patch-1

Fix global leaked variable 'arr'