removed servername variable, cleaned search function