changed some bashisms