Changed search.
Tidy and added API.