some improvements to paste
more improvements to paste