fixed bug with parallel brute force. Made writing out into a function