use some totally overkill goroutines to process files more quickly. split into functions