finished and tested paste/resize functions