Testing loop

The earlier attempt failed with error:
undefined method `[]' for nil:NilClass

Now attempting to try with .first