Script now works on unix systems which wasn't the case earlier.