This is definitely much easier and does not even require any change in the code....
Support for MIN and MAX in range size constraints