working version, still need to debug function for filtering for multiple checks