IMPORTANT: changed bias term from -log(n/2) to -1/2