Detection and following code