Viewport tweaked, function call order changed