Update memory.js

fixes #376