clarified awk script considerably