implementing memory store