updated viewport to singleton pattern. Starting comments for JSDocs