Use dictionary instead of array, updated small input