Modified to use 'head -n 1' instead of 'head -1' since some versions of head