advanced algorithms for compatibility