memory v2 - with changes

added document.ready to js