Added hooks for reading/writing scratch data
Remainer changes for reading/writing scratch data