Contains function to filter list due to input value.