Implemented naive optimization for isomorphic checks