1. Cleaned up error logging and workspace setting
2. Reduced amount of data travelling between asynchronous functions
3. Added hooks in rScripts to increment sample size