finishing up the result filtering