taking code out of bookmarklet