added comments for search implementation