Updated bash code