Adding maximal rectangle