Added auto-paste and a lot of comments.