made a fine mess of adding/removing samples in detect.lua