first implementation of detector