fixed selectBestPatterns