Implemented best candidate filtering.
Added multi threading support for computing the samples.