implement best_script