Implement prepend and append.