corrected function for case that A_better > N_eff

in 17 minutes and 9 seconds, using 0 compute credits, and was queued for 2 seconds
latest