Added option to append/prepend