moved diff tile detection into a method