Added comments and corrected search retrieval error