comments and an optimization

commented advanced search functions and removed an string duplication
that was entirely unnecessary