created MemPointer class which behaves more like a file