bug fix and tests for run method
cleaned up base class