Reindent code
Fix originalOnAdd being global