Added automatic resizing