adapted lichen to provide a generic function for resizing