Updated for max / min height.
Minified code.