added memory part writ back part still not complete