Add resizing function & Restructure