Updated Viewport Code