Added the memory mode + improved the overall performances