added basic resizing code. needs some changes