Logic for structure determination