old awk script (for reference)