Modified python script search method