Added dynamic resizing