simplified append and prepend