Add logging and viewport control