find the best rectangle