Updated documentation and rewrote MemoryManagement methods