Implemented search loops