Minor code factoring.
Correct the header double definition protection
Add instructions to get the first and the last value of the array