added optional constraint parameter to widen and heighten