fix up main script to properly direct output and do in parallel