replace more popen calls with clever globbing (halves execution time on Ubuntu)