viewport code