Added code for viewport