Tried to implement search, but ran into errors