adding support for appending and prepending