implemented scratchpad patch
fixed bug with wrong addressing
added unit tests for scratchpad patching