Added viewport resizing to code