viewer built. improved validity logic.