Updated maximal rect for efficiency

Changed from linked list to array for constant time access