function viewer sort of works