Added patch overlap checking