added slice function to call unfilteredData array by value and not by reference
solved merge conflict