added windows mem function