using awk to implement features