Added memory thread, working except the running from memory