Changed array structure to key value per code review