Revert "Revert "The basic collision logic with the search method""

This reverts commit a44100ccb6ea09a28c173dbdf24d12392a95dd2f.