Start adding detection code