Added some code for the viewport