test1.sh added, major refactoring