adding HTMLPreview instructions, better javascript