fix array declarationand variable rename