Added resizing code