turn array into dictionary