added variance calculation for apd brute-force