Added finding the terminals max size