rename variables
make funcition for clear working directory.
minor refactoring