Added 'head' and 'tail' methods