implemented resizing function and adjusted the parameters it is called with