Added very rough resizing function