no more awk dependency; changed variable names accordingly.