Added logic to iterate through address_components instead of manually indexing