Added headtail()