changed implementation to use search