moved some vars outside awk