head_tail function

Head and tail methods