Adding viewport code