Added java files for filtering algorithm