searchMaximalArea modified for some situations