Refactoring, minor changes in run.sh