refactored conflict detection

engine unfinished