working on fixing a scoped array