use head, tail and length on vector