changed coverage test from awk to function