Added parallel code for the brute force method