I'm just trying to understand that piece of code ...
You are ignoring other array elements besides the first one?
What happens in case the array is empty?