using lambdas to detect fragments