Renamed 'sp' to mem_ptr
Const documentation
Const code now writing to file correctly.
Added pairs, needs to see why pairs aren't recognized.