Team LEAF detection code