added extension to Array for head and tail