Try the seed as a JS class, without document.write, but the good parts remain.