adding methods to constrain the height or width