edit: fixes for Maximum Likelihood filtering + speed optimizations

Signed-off-by: Stephen L. <lrq3000@gmail.com>
edit: fix + optimizations for Maximum Likelihood filtering rule

Signed-off-by: Stephen L. <lrq3000@gmail.com>