changed mem1 a bit