Improved bash-scripts. Now works