Complete Search Function

Search function is updated and completed.