viewer2 compiles but doesn't run correctly