First version of memory flipping