Used dictionary instead of array