head and tail now operate on strings