made simple piece diff function for search