Remove unused scratchpad.
Remove redundant brackets and $.