Implement search using CPS